home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 151-175 / scopedisk160 / rexxarplib252 / docs / rexxarplib.doc < prev    next >
Text File  |  1995-03-19  |  37KB  |  797 lines

  1. +----------------------------------------------------------------------+
  2. |                                                                      |
  3. |                  D I S C L A I M E R   N O T I C E                   |
  4. |                                                                      |
  5. |  This document and/or  portions of the material and  data furnished  |
  6. |  herewith,  was developed under sponsorship of the U.S. Government.  |
  7. |  Neither the U.S.  nor  the U.S.D.O.E.,  nor  the  Leland  Stanford  |
  8. |  Junior University, nor their employees,  nor their respective con-  |
  9. |  tractors, subcontractors, or their employees, makes  any warranty,  |
  10. |  express or implied, or assumes any liability or responsibility for  |
  11. |  accuracy,  completeness or  usefulness of any information, appara-  |
  12. |  tus, product or process disclosed, or represents that its use will  |
  13. |  not infringe privately-owned rights.  Mention of any product,  its  |
  14. |  manufacturer, or suppliers shall not, nor is it intended to, imply  |
  15. |  approval, disapproval, or fitness for any particular use. The U.S.  |
  16. |  and  the University at all times  retain the right to use and dis-  |
  17. |  seminate same for any purpose whatsoever.                           |
  18. |                                                                      |
  19. +----------------------------------------------------------------------+
  20.  
  21.  
  22.                    RexxArpLib.Library Version 2.52
  23.                    ===============================
  24.  
  25.                    Copyright (C) 1988, 1989, 1990
  26.  
  27.                                 by
  28.  
  29.                           W.G.J. Langeveld
  30.  
  31.          Stanford Linear Accelerrator Center
  32.  
  33.  
  34.  
  35. Version 2.52:
  36. -------------
  37.  
  38.     This release was necessary to fix problems with AmigaDOS 2.0
  39. shared screens. As of version 1.45, screenshare.library supports 2.0-style 
  40. shared screens, but the previous versions of rexxarplib contained code that
  41. would prevent some functions to work with such screens because they have
  42. slightly different properties. Do not forget to install the new
  43. screenshare.library in libs:.
  44.  
  45.     16 October 1990, WGL
  46.  
  47.  
  48. Version 2.5:
  49. ------------
  50.  
  51.     Minor update. Two bugs in the FileList function were fixed: the third
  52. argument wouldn't work right if there was a fourth, and the Noexpand option was
  53. broken in the previous version. A problem in the documentation of some of the
  54. screen functions (ScreenRows/Cols/Lace/Color/ToBack/ToFront) was corrected. A
  55. ShowTitle function was added. The CreateHost function was modified, such that if
  56. the named public screen does not exist, the window will open on the WorkBench.
  57. Under 2.0, rexxarplib's screens now get the "3D" look. Some other esthetical
  58. problems with 2.0 were also fixed.
  59.  
  60.     22 August 1990, WGL
  61.  
  62.  
  63. Version 2.42 (internal release):
  64. -------------------------------
  65.  
  66.     Another minor update. The PostMsg() code was fixed for two little bugs:
  67. (1) when calling PostMsg() in rapid sequence from different ARexx programs, it
  68. was possible to wind up with an orphaned PostMsg window that would never go
  69. away; (2) after updating an existing PostMsg() window on a shared custom screen,
  70. it was impossible to ever close that screen.
  71.     The Area... functions have been completely rewritten. While they used to
  72. be simple interfaces to the AmigaDOS equivalents, they are no longer, although
  73. they still use the AmigaDOS functions down below. Advantages: areafills are now
  74. clipped against the window borders, there are 16 specific pattern fills and 125
  75. dithering patterns, the fills no longer take up as much memory as they used to,
  76. and the probability of a system crash with these functions is considerably
  77. reduced. "Problems": AreaEnd() now has an optional argument and SetOPen is now
  78. obsolete (See AreaEnd()), and fills involving areacircles and areaellipses that
  79. don't fit inside the window may now fail and only produce the outline of the
  80. fill.
  81.     Other minor changes: ScreenToFront/Back now return 0 when the screen
  82. doesn't exist, rather than signalling an error. Windows no longer have their
  83. minimum size set to their original size, so you can use sizing gadgets to 
  84. make windows smaller too. Boolean gadgets now also have their GADGIMMEDIATE
  85. flag set, so that GADGETDOWN messages are actually possible now. Note, that
  86. when you request to receive both GADGETUP and GADGETDOWN messages, each
  87. gadget will report to you its message string *twice*. They can be distinguished
  88. by including %l in the message string, so that you can parse on UP vs. DOWN.
  89. The OpenScreen() function acquired another flag, TRUNCATE. See the description
  90. of OpenScreen(). A few little bugs were fixed in IFFImage. Note: iff.library
  91. apparently still has some bugs. It may still cause crashes of the machine when
  92. used with DPaint brushes. When in doubt, use full IFF pictures. Send mail to
  93. Chris Weber to have it fixed... 
  94.     And finally, the entire code was carefully checked and improved to avoid
  95. crashes under low-memory situations.
  96.  
  97.     21 January 1990, WGL
  98.  
  99.  
  100. Version 2.3:
  101. -------------
  102.  
  103.     Minor update. A new option was added to FileList to inhibit expansion of
  104. file names where not wanted. DrawCircle apparently never worked, can't believe
  105. noone noticed: it is fixed now. A small bug in the simple requester code was
  106. found and fixed, as well as a few similar ones in the file requester interface
  107. code. Finally: the 'version' command will now properly display the version
  108. number of rexxarplib and rexxmathlib.
  109.  
  110.     20 May 1989, WGL
  111.  
  112.  
  113. Version 2.2a:
  114. -------------
  115.  
  116.     A small bug fix in IffImage().
  117.  
  118.     5 April 1989, WGL
  119.  
  120.  
  121. Version 2.2:
  122. ------------
  123.  
  124.     New in version 2.2 is an extension to the FileList() function. It can
  125. now expand the file names to include the full path, by supplying another
  126. argument. It will now also return the number of files in the .0 field of the
  127. stem variable, to make it more similar to ExecIO. A bug was fixed...
  128.     Also, version 2.2 now uses ARP's Getenv and Setenv calls, so that with
  129. ARP 1.3 you can use environment variables in the ENV: directory.
  130.     Another addition is a new option for IFFImage() allowing one to load
  131. images without changing the screen's colors.
  132.     Missing from the documentation so far has been that rexxarplib.library
  133. *requires* the presence of screenshare.library and diskfont.library in your
  134. current libs: directory. Several reports about library functions only returning
  135. error 12 have been due to these libraries not being present.
  136.     There was also a mistake in the documentation. The function that used
  137. to be listed as FreeMenu() is really called RemoveMenu().
  138.     The behavior of GetEnv() was changed by popular request. It will no
  139. longer generate an error when the argument is not an existing env variable.
  140. Instead it will return an empty string.
  141.  
  142.     20 February 1989, 8 March 1989, WGL
  143.  
  144. Version 2.1:
  145. ------------
  146.  
  147.     New in version 2.1 are the general function ScreenColor, and the
  148. CreateHost-related functions ReadHost, SetGadget and IFFImage. The allowed
  149. flag for AddItem and AddSubItem is now a specific one (this is an "incompatible"
  150. change). CloseWindow now allows the host to stay around through a second
  151. argument. The window flag DELTAMOVE was added for OpenWindow, and the window
  152. location is now available in reports (%e and %f).
  153.     The function IFFImage needs some explanation. It allows you to display
  154. (a portion of) an IFF image in your CreateHost window. For the time being, this
  155. function makes use of the iff.library written by Christian Weber. However, there
  156. is a suspicion that this library may cause the occasional system crash, and it is
  157. known that DPaint-style brushes are not supported. Only straight IFF picture
  158. files are known to work more or less reliably. At some point I intend to use
  159. something else.
  160.  
  161. Version 2.0:
  162. ------------
  163.  
  164.     Originally, this library was supposed to be an ARexx interface to the
  165. ARP library. However, although it indeed interfaces to some of the ARP
  166. functions, it has become much more of an interface to various Intuition
  167. functions. I have considered renaming the library to something else, but by now
  168. everyone refers to it by this name, so I'll leave it like it is.
  169.     Version 2.0 is pretty much the final version. The library has grown
  170. considerably since the first release, and it is about as big as a library should
  171. ever get. If I find the need for a lot of other functions, they'll have to go
  172. into a different library.
  173.     The library contains over 50 functions now. One is Charlie's famous ARP
  174. file requester, another is a simple combination string/boolean requester that
  175. does auto-everything. All you have to do is specify the strings you want it to
  176. display. Then there are environment variable things, and a simple message window
  177. you can keep hanging around. On popular request, there is now a wildcard
  178. expander (not to be confused with a 'directory' function!) that uses the new Rexx
  179. Variables Interface (RVI).
  180.     The major new things though, are the interface routines to Intuition.
  181. You can now open screens and windows, add boolean and string gadgets to them as
  182. well as menus, draw lines and areas and circles and whatever. You can make your
  183. gadgets, menus, and windows send messages to wherever you like and you can 
  184. format those messages, though they have to ARexx messages, in any way you like,
  185. using any information that's currently available. All this is rather hard to
  186. explain. You'll really have to play with it and look at some examples.
  187.     As usual, this stuff is NOT public domain, but freely distributable.
  188.  
  189.     So have fun!
  190.  
  191.     Willy.
  192.  
  193.  
  194.  
  195. The functions are listed below.
  196. --------------------------------------------------------------------------------
  197.  
  198. GetFile
  199. =======
  200.  
  201.     Calling sequence:
  202.  
  203.     result = GetFile(x, y, pathname, filename, hailstring, publicscreen)
  204.  
  205.     x            = x coordinate of top-left corner of requester.
  206.     y            = y coordinate of top-left corner of requester.
  207.     pathname     = Default path name, first path name to be searched.
  208.         filename     = Default file name.
  209.         hailstring   = User instruction string.
  210.         result       = The selected path/file name
  211.         publicscreen = Name of a public screen (optional).
  212.  
  213.     All arguments are optional, but the order is fixed. Therefore if only
  214. the second or third argument is specified, it needs to be prefixed by
  215. sufficient commas.
  216.     The selected path concatenated with the selected file name are
  217. returned as 'result'. Notice, that the result is not necessarily an existing
  218. file. It is up to the user to ascertain that the result is suitable for his
  219. purposes. If the user hits "CANCEL", the result is an empty string. Notice
  220. that another way the result comes out to be empty is when the user leaves the
  221. requester hitting "OKAY" when both the path and file string gadgets are
  222. empty.
  223.     If 'publicscreen' is specified, the function will try to find the screen
  224. of that name. If it is set up properly, the requester will open on that 
  225. screen. If not, the requester will appear on the Workbench. The mechanism that
  226. is currently used for this is subject to change.
  227.  
  228. Request
  229. =======
  230.  
  231.     Calling sequence:
  232.  
  233.     result = Request(x, y, prompts, string, okaytext, canceltext, publicscreen)
  234.  
  235.     x             = x coordinate of top-left corner of requester.
  236.     y             = y coordinate of top-left corner of requester.
  237.         prompts       = A string which will be displayed above any gadgets.
  238.                         Any embedded '\' characters will be treated as a line
  239.                         break.
  240.         string        = The default string to be displayed in a string gadget.
  241.                         If omitted, no string gadget will be provided.
  242.     okaytext      = The text to be used for an Okay gadget.
  243.                     If omitted, no okay gadget will be provided.
  244.     canceltext    = The text to be used for a Cancel gadget.
  245.                     If omitted, no cancel gadget will be provided.
  246.         publicscreen  = Name of a public screen (optional).
  247.  
  248.     All arguments are optional, but the order is fixed. Therefore if
  249. only the second or third argument is specified, it needs to be prefixed by
  250. sufficient commas.
  251.     If a string gadget is present, but no okay gadget, the string
  252. will be returned after modification by the user in result when the user
  253. hits <return>.
  254.     If both a string gadget and an okay gadget are present, the string
  255. will be returned in result only when the user clicks on the okay gadget.
  256.     If no string gadget is present, clicking of the okay gadget (if 
  257. present) will cause the return in result of the string "OKAY".
  258.     In any case, if the user clicks either the cancel gadget or the
  259. close gadget, an empty string will be returned. Notice that another way the
  260. result comes out to be empty is when the user leaves the requester hitting
  261. "OKAY" when the string gadget is empty.
  262.     If 'publicscreen' is specified, the function will try to find the screen
  263. of that name. If it is set up properly, the requester will open on that 
  264. screen. If not, the requester will appear on the Workbench. The mechanism that
  265. is currently used for this is subject to change.
  266.  
  267. PostMsg
  268. =======
  269.  
  270.     This function sets up a window with text. It returns immediately to
  271. the caller. Subsequent calls will erase lines and fill them with new text.
  272. If a line has zero length, the line will NOT be erased. This has the advantage
  273. that you can change the text in a line without redisplaying text in another
  274. line. It has the disadvantage that in order to erase lines, you have to
  275. specify at least a single space for each line you want to erase.
  276. The window will remain open, until a call is made with too few arguments. 
  277. This is NOT a reentrant function: there is only one window pointer, and
  278. subsequent calls by ANY REXX process will affect the window.
  279.  
  280.     Calling sequence:
  281.  
  282.     result = PostMsg(x, y, strings, publicscreen)
  283.  
  284.     x             = x coordinate of top-left corner of requester.
  285.     y             = y coordinate of top-left corner of requester.
  286.         string        = A string which will be displayed above any gadgets.
  287.                         Any embedded '\' characters will be treated as a line
  288.                         break.
  289.     result        = 1 for success, 0 otherwise.
  290.         publicscreen  = Name of a public screen (optional).
  291.  
  292.     All arguments are optional, but the order is fixed. Therefore if
  293. only the second or third argument is specified, it needs to be prefixed by
  294. sufficient commas.
  295.     Examples:
  296.        Postmsg(50, 50, "This is line 1\This is line 2")
  297. will cause a window to appear with two lines of text. A subsequent call
  298.        Postmsg(50, 50, "\This is a new line 2")
  299. will cause the second line of the window to be replaced by the new text. The
  300. construct:
  301.        PostMsg(50, 50, " \")
  302. will erase the first line but leave the second one alone (notice the space).
  303.     If too few arguments are specified, this function will cause the
  304. window to be closed.
  305.     If 'publicscreen' is specified, the function will try to find the screen
  306. of that name. If it is set up properly, the requester will open on that 
  307. screen. If not, the requester will appear on the Workbench. The mechanism that
  308. is currently used for this is subject to change.
  309.  
  310. Getenv
  311. ======
  312.  
  313.     Calling sequence:
  314.  
  315.     result = Getenv(variable)
  316.  
  317.     variable   = Environment variable.
  318.         result     = The value of the environment variable.
  319.  
  320.     This function gets the value of an environment variable. If the
  321. variable does not exist, an empty string will be returned.
  322.  
  323. Setenv
  324. ======
  325.  
  326.     Calling sequence:
  327.  
  328.     result = Setenv(variable, valuestring)
  329.  
  330.     variable    = Environment variable.
  331.     valuestring = The new value for the environment variable.
  332.         result      = Always 1.
  333.  
  334.     This function (creates and) sets the environment variable to a
  335. a (new) value. If 'valuestring' is missing, the function will remove the
  336. environment variable.
  337.  
  338. ScreenToBack, ScreenToFront
  339. ===========================
  340.  
  341.     These functions depth arrange screens. If no argument is specified,
  342. the screen operated on is the Workbench screen. If the name of a public screen
  343. is specified, it will be affected.
  344.  
  345.     Calling sequence:
  346.  
  347.     result = screentoback(publicscreen)
  348.     result = screentofront(publicscreen)
  349.  
  350.         publicscreen  = Name of a public screen (optional).
  351.  
  352.     The argument is optional. If 'publicscreen' is specified, the function
  353. will try to find the screen of that name. If it is set up properly, the screen
  354. will be moved to the back/front. If the argument is not specified, the function
  355. will operate on the Workbench screen. The mechanism that is currently used for
  356. this is subject to change. The functions return 1 on success and 0 on failure.
  357.  
  358. ScreenRows, ScreenCols, ScreenLace, ScreenColor
  359. ===============================================
  360.  
  361.     These functions retrieve info about screens. If no argument is
  362. specified, the screen operated on is the Workbench screen (with the exception of
  363. ScreenColor). If the name of a public screen is specified, it will be used.
  364.  
  365.     Calling sequences:
  366.  
  367.     result = ScreenRows(publicscreen)     /* return number of rows */
  368.     result = ScreenCols(publicscreen)     /* return number of columns */
  369.     result = ScreenLace(publicscreen)     /* return interlace */
  370.     result = ScreenColor(publicscreen, n) /* return color n */
  371.  
  372.         publicscreen  = Name of a public screen (optional, except
  373.                         with ScreenColor).
  374.  
  375.     ScreenRows and ScreenCols retrieve the number of rows and columns in
  376. pixels. The function ScreenLace() returns 0 if the screen is not interlaced, and
  377. 1 if it is. The functions return -1 if the information could not be found, as is
  378. the case if the named public screen does not exist. Notice, that
  379. ScreenRows/Cols/Lace can be used to determine whether a public screen of a
  380. particular name exists.
  381.     ScreenColor retrieves the RGB values of the selected color in the
  382. format: <red><space><green><space><blue>, e.g:   15 0 0  for an all red screen.
  383.     Except with ScreenColor, the first argument is optional.  If
  384. 'publicscreen' is specified, the function will try to find the screen of that
  385. name. If it is set up properly, information about the screen will be returned.
  386. If the argument is not specified, the function will operate on the Workbench
  387. screen.  ScreenColor only operates on public screens. The mechanism that is
  388. currently used for this is subject to change.
  389.  
  390. OpenScreen, CloseScreen
  391. =======================
  392.  
  393.     These functions allow you to open public custom screens.
  394.  
  395.     Calling sequence:
  396.  
  397.     result = OpenScreen(topedge, depth, modes, defaulttitle, publicscreen)
  398.     result = CloseScreen(publicscreen)
  399.  
  400.     topedge       = Y coordinate of top edge of the screen.
  401.     depth         = Number of bitplanes.
  402.     modes         = Viewmodes and type of screen. The currently supported
  403.                         viewmodes are "HIRES", "LACE", and "HAM". Currently
  404.                         supported types are "SCREENBEHIND", and "TRUNCATE".
  405.     defaulttitle  = Default title for the screen title bar.
  406.         publicscreen  = Name of a public screen (optional).
  407.  
  408.     result        = 0 on failure, 1 on success.
  409.  
  410.     The last argument is required, therefore you must supply sufficient
  411. commas and a name for the public screen to be created/closed. With openscreen,
  412. leaving out any of the other arguments will cause defaults to be used. They are
  413. topedge = 0, depth = 2, modes = 0 (meaning LORES, no LACE), and no default
  414. title. This is equivalent to specifying 0 for all arguments (a depth of 0 is
  415. illegal and will be changed to 2). All created screens are CUSTOM screens.
  416. The "TRUNCATE" screen type is not really an Intuition construct. It is only
  417. useful when "topedge" is non-zero: the screen will have the size of its visible
  418. portion at the time it is opened. Otherwise a full sized screen is opened,
  419. which is just displaced by "topedge". This compensates somewhat for the lack
  420. of ability to specify the screen size.
  421.     The mechanism that is currently used for public screens is subject to
  422. change.
  423.     ***NOTE: It is perfectly possible to apply closescreen() to another
  424. application's custom screen (if it is public, using the same conventions as
  425. used here). If you attempt this, a software failure is almost guaranteed. Only
  426. use closescreen() on screens you created using openscreen()!
  427.  
  428. ShowTitle
  429. =========
  430.  
  431.     This function shows or hides the title bar of a named public
  432. screen.
  433.  
  434.     Calling sequence:
  435.  
  436.     result = ShowTitle(publicscreen, yesno)
  437.  
  438.     publicscreen  = name of a publicscreen
  439.     yesno         = 0 or 1.
  440.  
  441.     If yesno is set to 1, the screen title of the named public screen
  442. will be shown, if set to 0, it will be hidden. This function does not
  443. operate on the Workbench.
  444.  
  445. FileList
  446. ========
  447.  
  448.     This function does ARP pattern matching. Given a pattern, it will
  449. return all files and/or directories matching the pattern.
  450.  
  451.     Calling sequence:
  452.  
  453.     number = FileList(pattern, stem, type, expand)
  454.  
  455.     pattern       = a search pattern using ARP wildcards.
  456.         stem          = the NAME of a stem variable to be created.
  457.         type          = D - directories only. F - files only.
  458.         expand        = E - expand full path name. N - remove path name
  459.                     not specified: don't expand, but don't remove either.
  460.  
  461.     number        = the number of files matching the pattern.
  462.  
  463.     When files with names matching the  pattern are found, a stem variable
  464. with the name given by 'stem' is created in the current Rexx context. It has
  465. fields 1, 2, ... , <number> containing the names of the files. The return value
  466. and also the stem variable's field 0 are equal to the number of files. The last
  467. two arguments are optional: with 'type', when an F is specified, only files are
  468. listed. When a D is specified only directories are listed. With 'expand', if an
  469. E is specified, the full path name is expanded. If an N is specified, any
  470. pathname part of the pattern will be removed. Example: a simple directory
  471. program looks like
  472.  
  473.     /* Directory program, list everything, with full path */
  474.     arg pattern
  475.     if pattern = "" then pattern = "*"
  476.     numfils = FileList(pattern, myfilelist, , E)
  477.     do i = 1 to numfils; say myfilelist.i; end
  478.     exit
  479.  
  480. CreateHost
  481. ==========
  482.  
  483.     This function allows you to create a single window with gadgets, menus,
  484. text, graphics, etc. Of course, multiple copies of the function may be started
  485. up to create more windows, but each must have a unique 'controlport'. This
  486. function should be started up asynchronously, using runwsh, and one should wait
  487. for the 'controlport' to appear using e.g. WaitForPort.
  488.  
  489.     Calling sequence:
  490.  
  491.     runwsh 'call CreateHost(controlport, notifyport, publicscreen)'
  492.  
  493.     controlport   = Name of the message port this window should listen to.
  494.     notifyport    = Name of the message port that should be notified when
  495.                         an IDCMP event occurs.
  496.         publicscreen  = Name of a public screen (optional).
  497.  
  498.     When the function is first called, it will open a message port with the
  499. name given by "controlport". The function will then wait for commands coming in
  500. through this port. This may be accomplished using one of many intuition
  501. functions, as explained later. One of the first commands should be to open the
  502. associated window by calling OpenWindow (see later). It will then open a window
  503. as specified in the OpenWindow call. If any message arrives through the IDCMP of
  504. this window, a REXX message will be sent to the port specified as "notifyport"
  505. which either you should set up in your rexx macro for this purpose, or should be
  506. an otherwise existing rexx message port belonging to another process. In the
  507. case you set up your own port, make sure the message is replied to after having
  508. been  retrieved and examined. If the  notifyport does not exist, no message will
  509. be sent. The window can be closed by the rexx macro by calling the function
  510. CloseWindow (see later). On startup, the notify port is the same for all classes
  511. of messages. This can be changed using the SetNotify() function, see later.
  512.     The last argument is optional.  If 'publicscreen' is specified, the
  513. function will try to find the screen of that name. If it is set up properly, the
  514. window will be opened on it. If not, the window will be opened on the Workbench
  515. screen. The mechanism that is currently used for this is subject to change.
  516.  
  517. Supported Intuition (and other) functions with createhost
  518. =========================================================
  519.  
  520.     The following functions are implemented as CreateHost functions. The 
  521. first argument is always the name of the control port of the host that is
  522. supposed to execute the command. A little secret: you can send commands
  523. *directly* to the controlport also by constructs like "Address controlport
  524. commandname". However, this only works for commands without further arguments.
  525. For example, from WShell, "address controlport CloseWindow" is equivalent to
  526. "call CloseWindow(controlport)". This can come in incredibly handy at times.
  527. For example, when you want command hosts to send message to themselves: you
  528. can tell a host to send IDCMP events of class CLOSEWINDOW to itself...
  529. Boggles the mind yet? Read on...
  530.  
  531.    call ActivateGadget(controlport, gadgetid)
  532.         Tries to activate a string gadget with id 'gadgetid'.
  533.  
  534.    call ActivateWindow(controlport)
  535.  
  536.    call AreaCircle(controlport, xcenter, ycenter, radius)
  537.  
  538.    call AreaDraw(controlport, x, y)
  539.  
  540.    call AreaEllipse(controlport, xcenter, ycenter, radius1, radius2)
  541.  
  542.    call AreaEnd(controlport, pen)
  543.         The "pen" argument is optional, and overrides the default, which is
  544.         that the area fill should be done using the current A pen (set with
  545.         SetAPen()). Pen values less than 256 have the usual meaning. Pen
  546.         values of 256 + i, where i = 0 through 15, cause the fill to be
  547.         performed using one of 16 standard fill patterns. Pen values of
  548.     512 + i, where i = 0 through 124, cause the fill to be performed
  549.     using one of 125 dithering patterns. The dithering patterns use pens
  550.     0 through 7. If these pens are set to black, white, red, green, blue,
  551.     cyan, magenta and yellow respectively, then the dithering patterns
  552.     form 125 different colors. To calculate a particular color index for
  553.         use as "pen", take the color's R G and B values, where R, G and B
  554.         are 0, 1, 2, 3 or 4,  and use:
  555.  
  556.         pen = R * 25 + G * 5 + B
  557.  
  558.         For example, full white would be (R = 4, G = 4, B = 4) and pen = 124.
  559.     A bluish grey would be (2, 2, 3), pen = 63.
  560.     Adding 1024 to the pen number causes AreaEnd to have no effect at all.
  561.     Adding 2048 to the pen number will cause the fill to have an outline
  562.     with the outline pen being the current A pen.
  563.     The SetOPen function no longer affects Area draws as of this revision.
  564.         Bug: For some reason, area circles and ellipses don't seem to get
  565.         outlines when requested.
  566.  
  567.    call AreaMove(controlport, x, y) 
  568.  
  569.    call AddGadget(controlport, x, y, gadgetid, gadgettext, messagetext, hsize)
  570.         If hsize is specified, this call creates a string gadget of that
  571.         horizontal size and gadgettext is the default string. If hsize is
  572.         not specified, this call creates an autosizing boolean gadget, where
  573.         the text in gadgettext is displayed. In both cases, the string in
  574.         messagetext is sent to controlport (see also under OpenWindow). As
  575.         usual, the gadgettext for boolean gadgets may contain \ characters
  576.         to cause multiple lines of text (See e.g. PostMsg()).
  577.  
  578.    call AddItem(controlport, itemname, message, commandchar, mutualexclude, flag)
  579.         Add a new item with name 'itemname'. Optionally, you may specify a
  580.         command key abbreviation (right-Amiga 'commandchar') and a mutual exclude
  581.         mask. See Intuition manual. A special value of the mutual exclude mask
  582.         is -1: this means that the item will be toggle selectable. If the flag
  583.         argument is "SAMELINE", the item will be on the same line as the previous
  584.         item, otherwise, or if the argument is not present, it will be on the 
  585.         next line.
  586.         See also AddMenu(), AddSubItem(), RemoveMenu(), SetItem().
  587.  
  588.    call AddMenu(controlport, menuname)
  589.         Add a new menu with name 'menuname'. See also AddItem(), AddSubItem(),
  590.         RemoveMenu(), SetItem().
  591.  
  592.    call AddSubItem(controlport,itemname,message,commandchar,mutualexclude,flag)
  593.         Add a new subitem with name 'itemname'. Optionally, you may specify a
  594.         command key abbreviation (right-Amiga 'commandchar') and a mutual exclude
  595.         mask. See Intuition manual. A special value of the mutual exclude mask
  596.         is -1: this means that the item will be toggle selectable. If the flag
  597.         argument is "SAMELINE", the item will be on the same line as the previous
  598.         item, otherwise, or if the argument is not present, it will be on the 
  599.         next line.
  600.         See also AddMenu(), AddItem(), RemoveMenu(), SetItem().
  601.  
  602.    call BackFill(controlport)
  603.         This is not an intuition function. See OpenWindow().
  604.  
  605.    call CloseWindow(controlport, flag)
  606.         This function closes the window and deallocates all resources. The 'flag'
  607.         argument is optional. If present, and if the flag is equal to "CONTINUE",
  608.         the host will remain active. Otherwise, the host will exit.
  609.  
  610.    call Draw(controlport, x, y)
  611.  
  612.    call DrawCircle(controlport, xcenter, ycenter, radius)
  613.  
  614.    call DrawEllipse(controlport, xcenter, ycenter, radius1, radius2)
  615.  
  616.    call Exit(controlport)
  617.         This function closes the window, deallocates all resources and causes
  618.         the host to exit. Exit(), Quit() and Stop() are identical.
  619.  
  620.    call Flood(controlport, mode, x, y)
  621.         If mode is 0, the flood continues until pixels of the outline pen
  622.         color are found. If the mode is 1, the flood continues until pixels
  623.         of a different color than the pixel at x, y are found.
  624.  
  625.    call RemoveMenu(controlport)
  626.         Gets rid of any attached menu.
  627.  
  628.    call IFFImage(controlport, filename, x, y, width, height, flag)
  629.         Displays a chunk of size 'width', 'height' of an IFF ILBM file named
  630.         'filename' at x, y in the window. If x, y, width, and/or height are
  631.         omitted, suitable defaults are chosen. The colormap of the IFF file,
  632.         if any, is NOT used on the Workbench, but IS used on custom screens.
  633.         The 'flag' option can be set to 'NOCOLOR' (N is sufficient) to prevent
  634.         modifying the custom screen's colors.
  635.  
  636.    call ModifyHost(controlport, IDCMPclass, messagestring)
  637.         This function allows you to set the message string that is sent to 
  638.         the notifyport for a particular class of IDCMP events. See OpenWindow.
  639.  
  640.    call Move(controlport, x, y)
  641.  
  642.    call OpenWindow(controlport, leftedge, topedge, width, height,
  643.                                 idcmp, flags, title)
  644.         width and height may be set to 0 to get the maximum size of the window.
  645.         idcmp is a string that specifies the IDCMP for the window. Supported are:
  646.  
  647.            IDCMP message    |  default arg[0]          
  648.         --------------------+-------------------
  649.           "CLOSEWINDOW"     |  "%l"            
  650.           "MOUSEBUTTONS"    |  "%l"            
  651.           "GADGETUP"        |  <its string>   
  652.           "GADGETDOWN"      |  <its string>   
  653.           "MENUPICK"        |  "%l"            
  654.           "NEWSIZE"         |  "%l"            
  655.           "VANILLAKEY"      |  "%l"            
  656.           "RAWKEY"          |  "%l"            
  657.           "NEWPREFS"        |  "%l"            
  658.           "DISKINSERTED"    |  "%l"            
  659.           "DISKREMOVED"     |  "%l"            
  660.           "ACTIVEWINDOW"    |  "%l"            
  661.           "INACTIVEWINDOW"  |  "%l"            
  662.           "REFRESHWINDOW"   |  "%l"            
  663.           "MOUSEMOVE"       |  "%l"            
  664.           "DELTAMOVE"       |  "%l"            
  665.  
  666.         Any number of these may be specified in the OpenWindow call, by conca-
  667.         tenation. When any of these messages arrives at the IDCMP, a REXX
  668.         message is created with a particular string in Arg[0]. This string is
  669.         by default the one given in the table above, after substitution has
  670.         taken place for any two-character sequence starting with '%'.
  671.         The following substitutions will be made:
  672.  
  673.         Sequence: | Typical Use: |     Meaning:
  674.         ----------+--------------+---------------
  675.             %%    |              | A single % sign
  676.             %a    | Vanillakeys  | 'Code' is interpreted as an ASCII character.
  677.             %b    | Buttons      | SELECTDOWN, SELECTUP, MENUDOWN, MENUUP.
  678.             %c    |              | 'Code' is given as an integer.
  679.             %d    | Gadgets      | the gadget id.
  680.             %e    | Window       | the TopEdge of the window
  681.             %f    | Window       | the LeftEdge of the window
  682.             %g    | Gadgets      | the string inside a string gadget goes here.
  683.             %h    | Newsize      | the window height.
  684.             %i    | Menus        | the item number.
  685.             %l    | Any          | the name of the IDCMP class.
  686.             %m    | Menus        | the menu number.
  687.             %q    |              | 'Qualifier' is given as an integer.
  688.             %s    | Menus        | the sub-item number.
  689.             %t    | Time         | the number of seconds since January 1 1980.
  690.             %w    | Newsize      | the window width.
  691.             %x    | Mouse        | the X position of the mouse pointer.
  692.             %y    | Mouse        | the Y position of the mouse pointer.
  693.           %0-%15  |              | which Arg to use.
  694.  
  695.         For example, if the message string of some gadget is
  696.  
  697.             "Mouse is %x, %y%3gadget string is %g"
  698.  
  699.         the following might be sent to the notifyport in Arg[0] when someone
  700.         hits return in that gadget, after typing "This is a test":
  701.  
  702.             Mouse is 320, 200
  703.  
  704.         while Arg[3] of the Rexx message would contain the string:
  705.  
  706.             gadget string is This is a test
  707.  
  708.         The default string for non-gadgets/menus is "%l", which means that they
  709.         only report their name. For example, if one would click in the window,
  710.         one would only receive a message with "MOUSEBUTTONS" in Arg[0]. However,
  711.         all arguments of the message that will be sent to the notifyport may be
  712.         changed using the ModifyHost() call, see there. Any of the escape
  713.         sequences above may be used in any string. Obviously, sometimes
  714.         particular sequences may not be very appropriate for certain uses.
  715.  
  716.         'flags' specifies the various window flags. Currently supported are:
  717.         "WINDOWCLOSE", "WINDOWSIZING" (and "SIZEBRIGHT", "SIZEBBOTTOM"),
  718.         "WINDOWDEPTH", "WINDOWDRAG", "BORDERLESS", "ACTIVATE" and
  719.         "NOCAREREFRESH".   A special flag can be set: "BACKFILL". It implies
  720.         a call to BackFill() after opening the window. It sets the window's
  721.         background to the current requester-style background color.
  722.  
  723.    call Quit(controlport)
  724.         This function closes the window, deallocates all resources and causes
  725.         the host to exit. Exit(), Quit() and Stop() are identical.
  726.  
  727.    call ReadGadget(controlport, gadgetid)
  728.         This function will cause the gadget 'gadgetid' to send its message
  729.         text (after substitutions, of course).
  730.  
  731.    call ReadHost(controlport, notifyport, messagetext)
  732.         This function will cause the message text (after substitutions, of
  733.         course) to be sent to the notifyport.
  734.  
  735.    call RectFill(controlport, xmin, ymin, xmax, ymax) 
  736.  
  737.    call RefreshGadgets(controlport)
  738.  
  739.    call RemoveGadget(controlport, gadgetid)
  740.  
  741.    call SetAPen(controlport, pennumber)
  742.  
  743.    call SetBPen(controlport, pennumber)
  744.  
  745.    call SetDrMd(controlport, mode)
  746.         mode can be any of JAM1, JAM2, INVERSVID or COMPLEMENT.
  747.  
  748.    call SetDrPt(controlport, pattern)
  749.         pattern is interpreted as a long integer of which the bits form the
  750.         pattern.
  751.  
  752.    call SetFont(controlport, FontName, FontSize)
  753.  
  754.    call SetGadget(controlport, gadgetid, action)
  755.         Given a gadget id, perform action on the gadget. Supported are ON and
  756.         OFF, to set or clear the highlighting state of the gadget.
  757.  
  758.    call SetItem(controlport, menunumber, itemnuber, subitemnumber, action)
  759.         Given menu, item (and optionally subitem) numbers, perform action on
  760.         the menu item. Supported are ON and OFF, to set or clear the check mark.
  761.  
  762.    call SetNotify(controlport, IDCMPclass, newnotifyport)
  763.         This function allows you to change the name of the NotifyPort that 
  764.         message strings are sent to for a particular class of IDCMP events.
  765.  
  766.    call SetReqColor(controlport, pentype, colornumber)
  767.         This function allows you to change the color number assigned to
  768.         one of the various pentypes. Currently the pentypes are: BLOCKPEN,
  769.         DETAILPEN, BACKGROUNDPEN, PROMPTPEN, BOXPEN, SHADOWPEN, OKAYPEN,
  770.         and CANCELPEN.
  771.  
  772.    call SetOPen(controlport, pennumber)
  773.         SetOpen is mostly obsolete, see AreaEnd().
  774.  
  775.    call SetRGB4(controlport, pennumber, red, green, blue)
  776.         red, green and blue are values for the RGB content of the color to be
  777.         assigned to the pen. The values are taken mod 16.
  778.  
  779.    call Stop(controlport)
  780.         This function closes the window, deallocates all resources and causes
  781.         the host to exit. Exit(), Quit() and Stop() are identical.
  782.  
  783.    call Text(controlport, string) 
  784.  
  785.    call WindowText(controlport, text)
  786.         The string in text may contain \'s to indicate multiple lines of text.
  787.  
  788.    call WindowToBack(controlport)
  789.  
  790.    call WindowToFront(controlport)
  791.  
  792.    call WritePixel(controlport, x, y)
  793.  
  794.  
  795.  
  796.  
  797.